def add(x, y, z):
    return x + y + z

def add2(x):
    def fyz(y,z):
        return x+y+z
    return fyz

def add3(x,y):
    def fz(z):
        return x+y+z
    return fz

def add4(x):
    def fy(y):
        def fz(z):
            return x+y+z
        return fz
    return fy
#
print(add(1,2,3))
print(add2(4)(5, 6))
print(add3(4, 5)(6))
print(add4(4)(5)(6))